﻿create procedure dbo.GetMyOrders	

	(
		@UserID int
	)

AS
	/* SET NOCOUNT ON */
	
	SELECT     dbo.TakeoutUser.Id AS TakeoutUserID, dbo.TakeoutUser.TakeoutProviderID, dbo.TakeoutUser.IsPaid, dbo.TakeoutUser.Instructions, dbo.TakeoutUser.OrderTime, 
	                      dbo.TakeoutUser.FundsSecuredTime, dbo.TakeoutUser.OrderTotal, dbo.Menus.Name AS MenuName
	FROM         dbo.TakeoutUser INNER JOIN
	                      dbo.TakeoutProvider ON dbo.TakeoutUser.TakeoutProviderID = dbo.TakeoutProvider.Id INNER JOIN
	                      dbo.Menus ON dbo.TakeoutProvider.MenuID = dbo.Menus.Id
	WHERE     (dbo.TakeoutUser.UserID = @UserID)
	
	RETURN


